<template>
  <div class="grandson1">
    <h2>我是Grandson1组件</h2>
    <h3>我有个玩具：{{ toy }}</h3>
    <button @click="handleClick">玩具给我弟弟玩一玩</button>
  </div>
</template>

<script>
  export default {
    name:'Grandson1',
    data() {
      return {
        toy:'奥特曼'
      }
    },
    methods: {
      handleClick(){
        this.$bus.$emit('send-toy',this.toy)
      }
    },
  }
</script>

<style scoped>
  .grandson1 {
    margin-top: 10px;
    background-color: orange;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px;
  }
</style>